#pragma once

#include <windows.h>
#include "QvCommon.h"
#include "QvObject.h"
#include "QvString.h"

class QvToolkit_Export QvDebug : public QvObject
{
private:
    QvDebug(void);

public:
    virtual ~QvDebug(void);

public:
    static void PrintDebugString(const QvChar *wcsFormat, ...);

    static void InitStackWalker(const QvByte *szUserSymPath = NULL);

    static void GetStackTrace(QvString& str, CONTEXT *pContext = NULL);
    static void ShowStackTrace();
};

#ifdef _DEBUG
#define DebugString(...)       QvDebug::PrintDebugString(__VA_ARGS__)
#define Assert(Condition)      \
    if(!(Condition))\
    {\
        DebugString(L"\nAssert fail. [" L#Condition L"] At %s, %d\n", __FILE__, __LINE__);\
    }
#else
#define DebugString(...)
#define Assert(Condition)
#endif


